<?php
/** @var EmpresaController $this */
/** @var Empresa $model */
/** @var AweActiveForm $form */
$form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
    'id' => 'empresa-form',
    'type' => 'horizontal',
    'enableAjaxValidation' => true,
    'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false,),
    'enableClientValidation' => true,
        ));
?>

<div class="well blue ">
    <div class="well-header">
        <h5><i class="icon-briefcase"> <?php echo Yii::t('AweCrud.app', $model->isNewRecord ? 'Create' : 'Update') . ' ' . Empresa::label(); ?></i> </h5>

    </div>
    <div class="well-content">

        <div class="row-fluid">

            <div class="span6">
                <?php echo $form->dropDownListRow($model, 'id_categoria', array('' => ' -- Seleccione -- ') + CHtml::listData(Categoria::model()->findAll(), 'id', Categoria::representingColumn())) ?>

                <?php echo $form->dropDownListRow($model, 'industria_id', array('' => ' -- Seleccione -- ') + CHtml::listData(Industria::model()->findAll(), 'id', Industria::representingColumn()), array('prompt' => Yii::t('AweApp', 'None'))) ?>

                <?php echo $form->textFieldRow($model, 'nombre', array('maxlength' => 64)) ?>

                <?php echo $form->textFieldRow($model, 'razon_social', array('maxlength' => 64)) ?>

                <?php echo $form->textFieldRow($model, 'documento', array('maxlength' => 20)) ?>

                <?php echo $form->textFieldRow($model, 'website', array('maxlength' => 255)) ?>
          
                <?php echo $form->textAreaRow($model, 'descripcion', array('rows' => 3, 'cols' => 50)) ?>

                <label for="grupos"><?php echo Yii::t('app', 'Grupos'); ?></label>
                <?php
                echo CHtml::checkBoxList('Empresa[grupos]', array_map('AweHtml::getPrimaryKey', $model->grupos), CHtml::listData(Grupo::model()->findAll(), 'id', 'nombre'), array('attributeitem' => 'id', 'checkAll' => 'Select All'))
                ?>

            </div>    
        </div> 
        <div class="form_row wizard_buttons">

            <div class="form-actions-float flotante">
                <?php
                $this->widget('bootstrap.widgets.TbButton', array(
                    'buttonType' => 'submit',
                    'type' => 'success',
                    'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Save'),
                    'htmlOptions' => array('class' => 'blue btn')
                ));
                ?>
                <?php
                $this->widget('bootstrap.widgets.TbButton', array(
                    'label' => Yii::t('AweCrud.app', 'Cancel'),
                    'htmlOptions' => array('onclick' => 'javascript:history.go(-1)', 'class' => 'red btn')
                ));
                ?>
            </div>
        </div>
    </div>
</div>   
<?php $this->endWidget(); ?>
